<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Log in to the library</title>
<link rel="stylesheet" href="css/shootingStar.css">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div class="cm">
	<div class="night">
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	  <div class="shooting_star"></div>
	</div>
</div>
	<div class="bigNav">
		<div class="box">
			<form action="Servlet" method="post">
				<%
					String user = "";
					String paw = "";
					Cookie[] cookies = request.getCookies();
					for(int i = 0; i < cookies.length; i++){
						if(cookies[i].getName().equals("user"))	{
							user = cookies[i].getValue();
						}else if(cookies[i].getName().equals("paw")) {
							paw = cookies[i].getValue();
						}
					}
				%>
				<input type="text" class="zh" placeholder="User" name="user" value="<%=user%>"><br />
				<input type="password" class="paw" placeholder="PassWord" name="paw" value="<%=paw%>"><br />
				<input type="submit" value="" class="sub">
				<input type="checkbox" class="checkFlag" name="check" value="true">
			</form>
			<form action="regir.jsp">
				<input type="submit" value="" class="regir">
			</form>
		</div>
	</div>
	<%
		String mess = (String) request.getAttribute("mes");
		if (mess != null) {
			if(mess.equals("-1")) {
				%>
				<script type="text/javascript">
					alert("密码错误");
				</script>
				<%
			}else if(mess.equals("-2")){
				%>
				<script type="text/javascript">
					alert("账号不存在！");
				</script>
				<%
			}
			request.setAttribute("mes", null);
		}
	%>
</body>
</html>